<?php
// 链接
$servername="localhost";
$username="root";
$password="root";
$dbname="liuyanban";

$id=$_GET["id"];

$conn=new mysqli("localhost","root","root","liuyanban");
if($conn->connect_error){
    die("连接失败:" .$conn->connect_error);
}
$sql="SELECT * FROM `liuyan` WHERE `name` LIKE '%小%' ";
$result=$conn->query($sql);

?>
<?php
$id =$_GET["id"];
$name=$_GET["name"];
$text=$_GET["text"];

$conn=new mysqli("localhost","root","root","liuyanban");
if($conn->connect_error){
    die("连接失败");
}
$sql="UPDATE `liuyan` SET `name` ='$name' , `text` = '$text' WHERE `liuyan` . `id` =$id";
if($conn->query($sql)){
    echo "编辑成功";
}else{
    echo "编辑失败";
}
// 跳回首页
  header("Location:list.php");
?>